<?php

namespace LowCode\UI;

use LowCode\Support\JsExp;

/**
 *
 * 代码 SfcRender
 * @method static static make() SfcRender组件
 */
class SfcRender extends Node
{

    protected string $loaderJs = "https://unpkg.com/vue3-sfc-loader@0.9.5/dist/vue3-sfc-loader.js";
    public function __construct()
    {
        parent::__construct();
//        $this->addApi()
    }

    /**
     * @param string|JsExp $value
     * @return $this
     */
    public function apiPrefix(string|JsExp $value): static
    {
        return $this->prop("apiPrefix",$value);
    }

    /**
     * @param string|JsExp $value
     * @return $this
     */
    public function filename(string|JsExp $value = "app"): static
    {
        return $this->prop("filename",$value);
    }

    /**
     * @param string|JsExp $value
     * @return $this
     */
    public function filepath(string|JsExp $value = "views"): static
    {
        return $this->prop("filepath",$value);
    }

    /**
     * @param bool|JsExp $bool
     * @return $this
     */
    public function devMode(bool|JsExp $bool = true): static
    {
        return $this->prop("devMode",$bool);
    }

    /**
     * @param string|JsExp $file
     * @return $this
     */
    public function file(string|JsExp $file): static
    {
        return $this->prop("file",$file);
    }

    /**
     * @param array|JsExp $files
     * @return $this
     */
    public function files(array|JsExp $files): static
    {
        return $this->prop("files",$files);
    }

    /**
     * @param array|JsExp $values
     * @return $this
     */
    public function moduleCache(array|JsExp $values): static
    {
        return $this->prop("moduleCache",$values);
    }

    /**
     * @param array|JsExp $values
     * @return $this
     */
    public function stores(array|JsExp $values): static
    {
        return $this->prop("stores",$values);
    }

    /**
     * @param array|JsExp $values
     * @return $this
     */
    public function fetchOptions(array|JsExp $values): static
    {
        return $this->prop("fetchOptions",$values);
    }

    /**
     * @param array|JsExp $values
     * @return $this
     */
    public function asyncProps(array|JsExp $values): static
    {
        return $this->prop("asyncProps",$values);
    }

    /**
     * @return array
     */
    public function toArray(): array
    {
        return parent::toArray();
    }
}
